router.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
dl 0
loc 15
rs 9.4285
nop 1
1
import enhancer from './store-enhancer';
2
import reducer from './reducer';
3
import middleware from './middleware';
4
5
import createLocationParser from './parsers/locationToState';
6
import createRouteParser from './parsers/routeToLocation';
7
import { DEFAULT_SLICE } from './constants';
8
9
const createRouter = ({
10
    history,
11
    routes,
12
    slice = DEFAULT_SLICE,
13
    immutable = false
14
}) => {
15
    const locationParser = createLocationParser(routes);
16
    const routeParser = createRouteParser(routes);
17
18
    return {
19
        reducer: reducer({ locationParser, immutable }),
20
        enhancer: enhancer({ history, slice, locationParser, immutable }),
21
        middleware: middleware({ history, routeParser })
22
    };
23
};
24
25
export default createRouter;